<div id="view-content">
<!-- Colour Tabbed Block (Full Width) -->
		<div class="block block-colour">
			
			<!-- Block Header -->
			<div class="head">
				<div class="cap-left"></div>
				<div class="cap-right"></div>
				<div class="content">
				
					<!-- Block Title -->
					<h2><?php echo $this->translate->_('Devices belong to hub'); ?></h2>
					<!-- /Block Title -->
					
					<!-- Block Action Buttons -->
					<ul class="action-buttons">
						<li><a href="<?php echo $this->url(array('controller' => 'hubs', 'action' => 'index'), "default", true) ?>" title="<?php echo $this->translate->_('<< back to hubs'); ?>" class="button button-grey"><?php echo $this->translate->_('<< back to hubs'); ?></a></li>                                            
                                                <?php if($this->agent->canAddDevice()) { ?>
                                                <li><a href="<?php echo $this->url(array('controller' => 'devices', 'action' => 'add', 'hubid' => $this->hubid), "default", true) ?>" title="" class="button button-colour"><?php echo $this->translate->_('Add new device'); ?></a></li>
                                                <?php } ?>
					</ul>
					<!-- /Block Action Buttons -->
					
					<!-- Tabs JS -->
					<script type="text/javascript">
					$(function(){
						$('#tabs-two').sTabs();
					});
					</script>
					<!-- /Tabs JS -->
					
					<!-- Block Tabs Menu -->
					<ul class="block-tab-menu" id="tabs-two">
						<li><a href="#tab-list" title=""><?php echo $this->translate->_('List'); ?></a></li>
						<li><a href="#tab-help" title=""><?php echo $this->translate->_('Help'); ?></a></li>
					</ul>
					<!-- /Block Tabs Menu -->
					
				</div>
				<div class="clear-both"></div>
			</div>
			<!-- /Block Header -->
			
			<!-- Block Content -->
			<div class="block-content">
				
				<!-- Tab One -->
				<div id="tab-list">
<?php
if(!$this->devices) {
?>                                    
                                    	<!-- Standard Content -->
					<div class="standard-content">
						<h3><?php echo $this->translate->_('Devices are not defined'); ?></h3>
                                        </div>
<?php
} else {
?>                                    
                                        <form action="/devices/actions" method="post">
					<!-- Standard Table -->
					<table cellpadding="0" cellspacing="0" border="0" class="standard-table" summary="<?php echo $this->translate->_('List of agents'); ?>">
					  <caption><?php echo $this->translate->_('List of agents'); ?></caption>
						<thead>
							<tr>
								<th style="width: 25px" class="checkbox-cell"><input type="checkbox" name="check_all" value="1" id="check-all-table-two" /></th>
								<th style="width: 150px"><?php echo $this->translate->_('Name'); ?></th>
								<th style="width: 285px" class="center-cell"><?php echo $this->translate->_('Belongs to hub'); ?></th> 
								<th style="width: 140px" class="center-cell"><?php echo $this->translate->_('Values'); ?></strong></th>                                                                
								<th style="width: 80px" class="status-cell"><?php echo $this->translate->_('Device type'); ?></th>                                                                
								<th style="width: 80px" class="timestamp-cell"><?php echo $this->translate->_('Installed'); ?></th>
								<th style="width: 80px" class="status-cell"><?php echo $this->translate->_('Status'); ?></th>
                                                              <!--  <th class="order-cell"><?php echo $this->translate->_('Order'); ?></th> -->
							</tr>
						</thead>
						<tbody>
<?php
$counter = 1;
if($this->devices) {
    foreach($this->devices as $device) { 
    $counter++;      
?>
							<tr <?php #if($counter%2) { echo "class='even'"; }?>>
								<td style="width: 25px" class="checkbox-cell"><input type="checkbox" name="deviceid[]" value="<?php echo $device->getId() ?>" class="object-checkbox" /></td>
								<td style="width: 150px"><a href="<?php echo $this->url(array('controller' => 'devices', 'action' => 'edit', 'devid' => $device->getAttributes()->getId(), 'hubid' => $this->hubid), null, true) ?>" title=""><?php echo $device->getAttributes()->getName(); ?></a></td>
								<td style="width: 285px" class="center-cell"><?php echo $device->getService()->getName() . "<br/>(" . $device->getService()->getAgentdev()->getDevTypeName() . ")"; ?></td>
                                                                <td style="width: 140px"class="center-cell"><strong>-10 °C</strong></td>
                                                                <td style="width: 80px" class="block-cell block-cell-grey-dev-<?php echo $device->getDevicetype(); ?>"><?php echo $device->getDevicetype(); ?></td>                                                                
								<td style="width: 80px" class="center-cell"><?php echo $this->datetime($device->getUpdated()); ?></td>  
								<td style="width: 80px" class="action-device-cell center-cell">                                                                  
                                                                    	<?php echo $this->showiconsforagents("public", $device->getAccesstype(),null,"device"); ?>
                                                                        <?php echo $this->showiconsforagents("static", $device->getAttributes()->getStatic(), $device->getFixedstatic(),"device"); ?>
                                                                        <?php echo $this->showiconsforagents("active", $device->getAttributes()->getActive(),null,"device"); ?>
									<a href="" title=""><img src="/images/icons/stop.png" alt="" title="the device is not responding" width="16" height="16" /></a>
								</td>
                                                              <!--  <td class="center-cell"><input type="text" name="dfsdfs" value="" style="width: 40px"/></td>  -->
							</tr>
<?php
    }
}
?>                                                    
						</tbody>
					</table>
					<!-- /Standard Table -->
					
					<!-- Check All JS -->
					<script type="text/javascript">
						$('#check-all-table-two').click(function() {
						  var check_all = $(this);
						  if(this.checked)
							{  check_all.parents('table').find('.object-checkbox').attr('checked', 'checked');
							}
							else
							{  check_all.parents('table').find('.object-checkbox').removeAttr('checked');
							}
						});
					</script>
					<!-- /Check All JS -->
					
					<!-- Action Set & Pagination -->

					<div class="action-set-pagination">
						<div class="left">
                                                    <select name="doaction">
<?php
echo $this->actionsdropdownitems("devices");
?>
                                                    </select>
							<button type="submit" class="form-button-colour">Perform</button>
						</div>
						<div class="clear-both"></div>
					</div>

					<!-- /Action Set & Pagination -->
                                        </form>
<?php
}
?>                                         
				</div>
				<!-- /Tab One -->
				
				<!-- Tab Two -->
				<div id="tab-help" style="display: none">

					<!-- Standard Content -->
					<div class="standard-content">
						<h3>Tab Two Content Title</h3>
						<p>
							Lorem ipsum dolor sit amet, consectetur adipisicing elit, <a href="" title="">sed do eiusmod tempor</a> incididunt ut labore et dolore magna aliqua. 
							Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure 
							dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non 
							proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
						</p>
						<ul>
							<li>This is a long bullet point right here</li>
							<li>Bit of a shorter one now</li>
							<li>Then for a bit of a longer one again</li>
						</ul>
						<p>
							Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
							Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure 
							dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
						</p>
					</div>
					<!-- /Standard Content -->

				</div>
				<!-- /Tab Two -->
								
			</div>
			<!-- /Block Content -->
			
			<!-- Block Footer Cap -->
			<div class="block-footer-cap">
				<div class="cap-left"></div>
				<div class="cap-right"></div>
				<div class="content"></div>
			</div>
			<!-- /Block Footer Cap -->
			
		</div>
		<!-- /Colour Tabbed Block (Full Width) -->
</div>